﻿using dotHTML.HTML;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;
using System.Collections.Generic;
#pragma warning disable 0618
namespace TestdotHTML
{
    
    
    /// <summary>
    ///This is a test class for InputTest and is intended
    ///to contain all InputTest Unit Tests
    ///</summary>
    [TestClass()]
    public class InputTest {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext {
            get {
                return testContextInstance;
            }
            set {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Input Constructor
        ///</summary>
        [TestMethod()]
        public void InputConstructorTest() {
            Input target = new Input();
            Assert.AreEqual("<input/>", target.ToString());
        }

        /// <summary>
        ///A test for Accept
        ///</summary>
        [TestMethod()]
        public void AcceptTest() {
            Input target = new Input();
            target.Accept.Add("ac1");
            target.Accept.Add("ac2");
            Assert.IsTrue(target.Accept.Count == 2);
            Assert.IsTrue(target.Accept.Contains("ac1"));
            Assert.IsTrue(target.Accept.Contains("ac2"));
        }

        /// <summary>
        ///A test for AutoComplete
        ///</summary>
        [TestMethod()]
        public void AutoCompleteTest() {
            Input target = new Input();
            Nullable<bool> expected = new Nullable<bool>();
            Nullable<bool> actual;
            target.AutoComplete = expected;
            actual = target.AutoComplete;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for AutoFocus
        ///</summary>
        [TestMethod()]
        public void AutoFocusTest() {
            Input target = new Input();
            bool expected = false;
            bool actual;
            target.AutoFocus = expected;
            actual = target.AutoFocus;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Checked
        ///</summary>
        [TestMethod()]
        public void CheckedTest() {
            Input target = new Input();
            bool expected = false;
            bool actual;
            target.Checked = expected;
            actual = target.Checked;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Disabled
        ///</summary>
        [TestMethod()]
        public void DisabledTest() {
            Input target = new Input();
            bool expected = false;
            bool actual;
            target.Disabled = expected;
            actual = target.Disabled;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Form
        ///</summary>
        [TestMethod()]
        public void FormTest() {
            Input target = new Input();
            Form expected = new Form();
            Form actual;
            target.Form = expected;
            actual = target.Form;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for FormAction
        ///</summary>
        [TestMethod()]
        public void FormActionTest() {
            Input target = new Input();
            string expected = string.Empty;
            string actual;
            target.FormAction = expected;
            actual = target.FormAction;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for FormEncType
        ///</summary>
        [TestMethod()]
        public void FormEncTypeTest() {
            Input target = new Input();
            string expected = string.Empty;
            string actual;
            target.FormEncType = expected;
            actual = target.FormEncType;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for FormMethod
        ///</summary>
        [TestMethod()]
        public void FormMethodTest() {
            Input target = new Input();
            Nullable<FormMethodChoices> expected = new Nullable<FormMethodChoices>();
            Nullable<FormMethodChoices> actual;
            target.FormMethod = expected;
            actual = target.FormMethod;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for FormNoValidate
        ///</summary>
        [TestMethod()]
        public void FormNoValidateTest() {
            Input target = new Input();
            bool expected = false;
            bool actual;
            target.FormNoValidate = expected;
            actual = target.FormNoValidate;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for FormTarget
        ///</summary>
        [TestMethod()]
        public void FormTargetTest() {
            Input target = new Input();
            string expected = string.Empty;
            string actual;
            target.FormTarget = expected;
            actual = target.FormTarget;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Height
        ///</summary>
        [TestMethod()]
        public void HeightTest() {
            Input target = new Input();
            Nullable<int> expected = new Nullable<int>();
            Nullable<int> actual;
            target.Height = expected;
            actual = target.Height;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for List
        ///</summary>
        [TestMethod()]
        public void ListTest() {
            Input target = new Input();
            DataList expected = new DataList();
            DataList actual;
            target.List = expected;
            actual = target.List;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Max
        ///</summary>
        [TestMethod()]
        public void MaxTest() {
            Input target = new Input();
            Nullable<int> expected = new Nullable<int>();
            Nullable<int> actual;
            target.Max = expected;
            actual = target.Max;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for MaxLength
        ///</summary>
        [TestMethod()]
        public void MaxLengthTest() {
            Input target = new Input();
            Nullable<int> expected = new Nullable<int>();
            Nullable<int> actual;
            target.MaxLength = expected;
            actual = target.MaxLength;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Min
        ///</summary>
        [TestMethod()]
        public void MinTest() {
            Input target = new Input();
            Nullable<int> expected = new Nullable<int>();
            Nullable<int> actual;
            target.Min = expected;
            actual = target.Min;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Multiple
        ///</summary>
        [TestMethod()]
        public void MultipleTest() {
            Input target = new Input();
            bool expected = false;
            bool actual;
            target.Multiple = expected;
            actual = target.Multiple;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Name
        ///</summary>
        [TestMethod()]
        public void NameTest() {
            Input target = new Input();
            string expected = string.Empty;
            string actual;
            target.Name = expected;
            actual = target.Name;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Pattern
        ///</summary>
        [TestMethod()]
        public void PatternTest() {
            Input target = new Input();
            string expected = string.Empty;
            string actual;
            target.Pattern = expected;
            actual = target.Pattern;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for PlaceHolder
        ///</summary>
        [TestMethod()]
        public void PlaceHolderTest() {
            Input target = new Input();
            string expected = string.Empty;
            string actual;
            target.PlaceHolder = expected;
            actual = target.PlaceHolder;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for ReadOnly
        ///</summary>
        [TestMethod()]
        public void ReadOnlyTest() {
            Input target = new Input();
            bool expected = false;
            bool actual;
            target.ReadOnly = expected;
            actual = target.ReadOnly;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Required
        ///</summary>
        [TestMethod()]
        public void RequiredTest() {
            Input target = new Input();
            bool expected = false;
            bool actual;
            target.Required = expected;
            actual = target.Required;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for SelectionDirection
        ///</summary>
        [TestMethod()]
        public void SelectionDirectionTest() {
            Input target = new Input();
            string expected = string.Empty;
            string actual;
            target.SelectionDirection = expected;
            actual = target.SelectionDirection;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Size
        ///</summary>
        [TestMethod()]
        public void SizeTest() {
            Input target = new Input();
            Nullable<int> expected = new Nullable<int>();
            Nullable<int> actual;
            target.Size = expected;
            actual = target.Size;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Src
        ///</summary>
        [TestMethod()]
        public void SrcTest() {
            Input target = new Input();
            string expected = string.Empty;
            string actual;
            target.Src = expected;
            actual = target.Src;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Step
        ///</summary>
        [TestMethod()]
        public void StepTest() {
            Input target = new Input();
            Nullable<float> expected = new Nullable<float>();
            Nullable<float> actual;
            target.Step = expected;
            actual = target.Step;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Type
        ///</summary>
        [TestMethod()]
        public void TypeTest() {
            Input target = new Input();
            Nullable<Input.InputType> expected = new Nullable<Input.InputType>();
            Nullable<Input.InputType> actual;
            target.Type = expected;
            actual = target.Type;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for UseMap
        ///</summary>
        [TestMethod()]
        public void UseMapTest() {
            Input target = new Input();
            Map expected = new Map("name");
            Map actual;
            target.UseMap = expected;
            actual = target.UseMap;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Value
        ///</summary>
        [TestMethod()]
        public void ValueTest() {
            Input target = new Input();
            string expected = string.Empty;
            string actual;
            target.Value = expected;
            actual = target.Value;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ToStringTest() {
            Input target = new Input(Input.InputType.Checkbox);
            target.Accept.Add("ac1");
            target.Accept.Add("ac2");
            target.AutoComplete = true;
            target.AutoFocus = true;
            target.Checked = true;
            target.Disabled = true;
            target.FormAction = "formaction";
            Form f = new Form();
            f.ID = "formid";
            target.Form = f;
            target.FormEncType = "formenctype";
            target.FormMethod = FormMethodChoices.GET;
            target.FormNoValidate = true;
            target.FormTarget = "formtarget";
            target.Height = 1;
            DataList dl = new DataList();
            dl.ID = "dataid";
            target.List = dl;
            target.Max = 2;
            target.MaxLength = 3;
            target.Min = 4;
            target.Multiple = true;
            target.Name = "name";
            target.Pattern = "pattern";
            target.PlaceHolder = "placeholder";
            target.ReadOnly = true;
            target.Required = true;
            target.SelectionDirection = "sd";
            target.Size = 5;
            target.Src = "src";
            target.Step = 6;
            Map m = new Map("name");
            m.ID = "mapid";
            target.UseMap = m;
            target.Value = "value";
            Assert.AreEqual("<input accept=\"ac1,ac2,\" " +
                "autocomplete=\"on\" " +
                "autofocus=\"autofocus\" " +
                "checked=\"checked\" " +
                "disabled=\"disabled\" " +
                "form=\"formid\" " +
                "formaction=\"formaction\" " +
                "formenctype=\"formenctype\" " +
                "formmethod=\"get\" " +
                "formnovalidate=\"formnovalidate\" " +
                "formtarget=\"formtarget\" " +
                "height=\"1\" " +
                "list=\"dataid\" " +
                "max=\"2\" " +
                "maxlength=\"3\" " +
                "min=\"4\" " +
                "multiple=\"multiple\" " +
                "name=\"name\" " +
                "pattern=\"pattern\" " +
                "placeholder=\"placeholder\" " +
                "readonly=\"readonly\" " +
                "required=\"required\" " +
                "selectiondirection=\"sd\" " +
                "size=\"5\" " +
                "src=\"src\" " +
                "step=\"6\" " +
                "type=\"checkbox\" " +
                "usemap=\"mapid\" " +
                "value=\"value\"/>", target.ToString());
        }
    }
}
